﻿namespace Resonator.Domain.Services
{
	using System.Collections.Generic;
	using Castle.ActiveRecord;
	using NHibernate.Expressions;

	public interface IRepository<T> where T : class
	{
		T[] FindAll(DetachedCriteria detachedCriteria, params Order[] orders);

		T[] FindAll(params DetachedCriteria[] detachedCriteria);

		T Find(object id);

		IList<T> Search(string query);

		void Save(T instance);

		ISessionScope CreateSessionScope();

		DetachedCriteria CreateDetachedCriteria();

		void DeleteAll();

		void PurgeAll();

		void Optimize();
	}
}
